home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_30689.txt < prev    next >
Text File  |  1991-02-27  |  952b  |  25 lines

  1. -- card: 30689 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. The 'return' statement causes the function to terminate, and indicates the return value.
  11.  
  12. The parameters of the function (in this case the variable x) have the same scope and storage class as automatic variables:  they are only visible in the function body and they are allocated and deallocated upon entry to and exit from the function.
  13.  
  14. If the function does not require any formal parameters, the word 'void' should be used in place of its parameter list.  (In pre-ANSI C, the list is simply left empty.)  Likewise, if the function does not return a value its return type is declared as 'void'.  For example:
  15.  
  16.     void  do_nothing(void)
  17.     {
  18.         return;     /* if omitted, function terminates at close of function body */
  19.     }
  20.  
  21.  
  22.  
  23. -- part contents for background part 7
  24. ----- text -----
  25. 86